package Solution;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-03-09
 * Time: 22:00
 */

//https://leetcode.cn/problems/jewels-and-stones/submissions/411280581/
class Solution {
    public int numJewelsInStones(String jewels, String stones) {
        boolean[] judge = new boolean[100];
        int ls1 = jewels.length();
        for (int i = 0; i < ls1; i++) {
            judge[jewels.charAt(i) - 'A'] = true;
        }
        int num = 0;
        int ls2 = stones.length();
        for (int i = 0; i < ls2; i++) {
            if (judge[stones.charAt(i) - 'A']) {
                num++;
            }
        }
        return num;
    }
}
